import javax.print.DocFlavor;
import java.util.*;

public class Test {

    public static void main(String[] args) {
        Map<String, Integer> map = Collections.synchronizedMap(new HashMap<>());
    }

    public static void main3(String[] args) {
        Hashtable<String,Integer> hashtable = new Hashtable<>();
        hashtable.put("222",1);
        HashMap<String,Integer> hash = new HashMap<>();
        hash.put("111",1);
        hash.put(null,2);
        hash.put(null,3);
        System.out.println(hash.put("111", 2));
    }


    public static void main2(String[] args) {

        TreeSet<Integer> treeSet = new TreeSet<>();
        treeSet.add(1);

        TreeMap<String, Integer> treeMap = new TreeMap<>();
        treeMap.put("111",1);
        treeMap.put("222",2);
        treeMap.put("333",3);
        Set<Map.Entry<String, Integer>> entrySet = treeMap.entrySet();
        for (Map.Entry<String, Integer> entry : entrySet){
            System.out.println("key："+entry.getKey()+" value："+entry.getValue());
        }

        Iterator<Map.Entry<String, Integer>> iterator = entrySet.iterator();
        while (iterator.hasNext()){
            Map.Entry<String, Integer> next = iterator.next();
            System.out.println("key："+next.getKey()+" value："+next.getValue());
        }

    }





    public static void main1(String[] args) {
       BinarySearchTree bst = new BinarySearchTree();
        bst.insert(10);
        bst.insert(5);
        bst.insert(15);
        bst.insert(9);
        bst.insert(3);
        bst.insert(18);
        System.out.println(bst.search(18).val);
        bst.remove(10);



    }
}
